package com.tian.controller.pay;

import com.tian.common.annotation.LoginCheckAnnotation;
import com.tian.common.util.CommonResult;
import com.tian.common.util.PageResult;
import com.tian.dto.pay.ChargePayOrderCount4ManagementRespDto;
import com.tian.dto.pay.PayOrderQueryReqDto;
import com.tian.dto.pay.PayOrderQueryRespDto;
import com.tian.service.pay.PayOrderQueryService;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiResponse;
import io.swagger.annotations.ApiResponses;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.List;

/**
 * {@code @description:} 查询充值订单信息
 *
 * @author tianwc 公众号：Java后端技术全栈
 * 在线刷题 1200+java面试题和1000+篇技术文章：<a href="https://woaijava.cc/">博客地址</a>
 * {@code @date:} 2024-12-03 9:43
 * {@code @version:} 1.0
 */

@Slf4j
@RestController
@RequestMapping("/management/payment/order")
public class PayOrderManagementController {

    @Resource
    private PayOrderQueryService payOrderQueryService;

    @ApiOperation(value = "查询我的充值订单信息")
    @ApiResponses({@ApiResponse(code = 200000, message = "查询成功")})

    @PostMapping("/query")
    public CommonResult<PageResult<List<PayOrderQueryRespDto>>> query(@RequestBody PayOrderQueryReqDto payOrderQueryReqDto) {
        return payOrderQueryService.queryManagement(payOrderQueryReqDto);
    }

    @GetMapping("/count/index")
    public CommonResult<ChargePayOrderCount4ManagementRespDto> count() {
        return payOrderQueryService.count4Management();
    }
}
